package com.buka.controller;



import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.api.ApiController;
import com.baomidou.mybatisplus.extension.api.R;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.buka.dto.UserDto;
import com.buka.entity.User;
import com.buka.service.UserService;
import com.buka.util.JsonData;
import com.buka.vo.LoginUserVo;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

import javax.annotation.Resource;
import javax.mail.Multipart;
import javax.servlet.http.HttpServletRequest;
import java.io.Serializable;
import java.util.List;

/**
 * (User)表控制层
 *
 * @author makejava
 * @since 2025-07-30 16:34:06
 */
@RestController
@RequestMapping("api/user/v1")
public class UserController extends ApiController {

    @Resource
    UserService userService;

    @PostMapping("register")
    public JsonData register(@RequestBody UserDto userDto){
        return userService.register(userDto);
    }

    @PostMapping("login")
    public JsonData login(@RequestBody LoginUserVo loginUserVo, HttpServletRequest request){
        return userService.login(loginUserVo,request);
    }

}

